package net.lmc.realtime.jtp.jtprealtimeservice.mapper;

import net.lmc.realtime.jtp.jtprealtimeservice.bean.TrafficPvReport;
import net.lmc.realtime.jtp.jtprealtimeservice.bean.TrafficUvReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;
@Mapper
public interface TrafficChannelStatsMapper {
    @Select("SELECT\n" +
            " channel,\n " +
            " sum(uv_count) as uv_count\n" +
            " FROM jtp_log_report.dws_traffic_page_view_window_report\n" +
            " WHERE toDate(window_start_time) = #{date}\n" +
            " GROUP BY channel")
    List<TrafficUvReport> selectUvCount(@Param("date")String date);

    @Select("SELECT\n" +
            " channel,\n" +
            " sum(pv_count) as pv_count\n" +
            " FROM jtp_log_report.dws_traffic_page_view_window_report\n" +
            " WHERE toDate(window_start_time) = #{date}\n" +
            " GROUP BY channel")
    List<TrafficPvReport> selectPvCount(@Param("date")String date);
}
